//package com.yunhe.option.controller.data;
//
//import com.yunhe.option.domain.data.Version;
//import com.yunhe.common.model.ResultObject;
//import com.yunhe.option.service.data.VersionService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiImplicitParam;
//import io.swagger.annotations.ApiImplicitParams;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.http.HttpStatus;
//import org.springframework.http.ResponseEntity;
//import org.springframework.web.bind.annotation.*;
//
///**
// * 版本controller
// * @author liuronglei
// * @desc 版本控制类定义
// */
//@Api(value = "version", description = "版本维护", tags = {"Data_Version"})
//@RestController
//@RequestMapping("/versions")
//public class VersionController {
//
//    @Autowired
//    private VersionService versionService;
//
//    @ApiOperation("新增版本")
//    @RequestMapping(method = RequestMethod.POST)
//    public ResponseEntity<ResultObject> post(
//            @RequestBody Version version) {
//        version.setId(null);
//        Version result = versionService.create(version);
//        return new ResponseEntity<>(new ResultObject<>(result), HttpStatus.OK);
//    }
//
//    @ApiOperation("删除版本")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "type", value = "类型", required = true, dataType = "string", paramType = "path")
//    })
//    @RequestMapping(value = "byType/{type}", method = RequestMethod.DELETE)
//    public ResponseEntity<ResultObject> delete(
//            @PathVariable("type") String type) {
//        versionService.deleteByType(type);
//        return new ResponseEntity<>(new ResultObject<>(null), HttpStatus.OK);
//    }
//
//    @ApiOperation("修改版本")
//    @RequestMapping(method = RequestMethod.PUT)
//    public ResponseEntity<ResultObject> update(
//            @RequestBody Version version) {
//        Version result = versionService.update(version);
//        return new ResponseEntity<>(new ResultObject<>(result), HttpStatus.OK);
//    }
//
//    @ApiOperation("查找最新版本号")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "type", value = "类型", required = true, dataType = "string", paramType = "path")
//    })
//    @RequestMapping(value = "/byType/{type}", method = RequestMethod.GET)
//    public ResponseEntity<ResultObject> post(
//            @PathVariable String type) {
//        Version result = versionService.searchLatestVersionByType(type);
//        return new ResponseEntity<>(new ResultObject<>(result), HttpStatus.OK);
//    }
//}
